﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Interface.Api;

namespace yafc.TaskScheduler
{
	class Task
	{
		public delegate ApiResults Job(ApiArgs Args);
		public delegate void Listener(ApiArgs Args, ApiResults Results);

		#region Fields

		Job job;
		ApiArgs args;
		Listener listener;

		#endregion

		#region Constructors

		public Task(Job _Job, ApiArgs Args, Listener _Listener)
		{
			job = _Job;
			args = Args;
			listener = _Listener;
		}

		#endregion

		#region Public Methods

		public void process()
		{
			ApiResults results = job(args);
			listener(args, results);
		}

		#endregion
	}
}
